import { LANGUAGE, type LanguageType } from "@/constants/enums";

interface OptionsState {
  locale: LanguageType;
}

export const useOptionsStore = defineStore("options", {
  state: (): OptionsState => {
    return {
      locale: LANGUAGE.ZH,
    };
  },
  actions: {
    settingLocale(lang: LanguageType) {
      this.locale = lang;
    },
  },
  persist: {
    key: "preference",
  },
});
